package com.hotel.service.impl;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hotel.dao.CheckOutMapper;
import com.hotel.entity.CheckOut;
import com.hotel.service.CheckOutService;
@Service("checkOutService")
@Transactional(transactionManager="txManager")
public class CheckOutServiceImpl implements CheckOutService {
	
	@Resource
	private CheckOutMapper checkOutMapper;

	@Override
	public List<CheckOut> findMonthStatements(String month) {
		SimpleDateFormat df = new SimpleDateFormat("yyyy");
		String year = df.format(new Date());
		return checkOutMapper.findMonthStatements(year,month);
	}

	@Override
	public List<CheckOut> findAnnualStatements(String year) {
		return checkOutMapper.findAnnualStatements(year);
	}

}
